/*
 * @Author: 李小晴 2689279066@qq.com
 * @Date: 2023-06-13 13:55:22
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2023-07-12 16:42:51
 * @FilePath: \sys\src\api\sp\feed\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useAxios } from '@/hooks/web/useAxios'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 列表
export const spForageListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageList',
      data: data
    }
  })
}
// 新增
export const spForageAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageAddAdmin',
      data: data
    }
  })
}
// 编辑
export const spForageEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageEdit',
      data: data
    }
  })
}
// 删除
export const spForageDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageDel',
      data: data
    }
  })
}
// 归档
export const spForageEndApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageEnd',
      data: data
    }
  })
}
// 规格列表
export const spForageSpecsListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageSpecsList',
      data: data
    }
  })
}
// 规格新增
export const spForageSpecsAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageSpecsAddAdmin',
      data: data
    }
  })
}
// 规格修改
export const spForageSpecsEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageSpecsEdit',
      data: data
    }
  })
}

// 删除规格
export const spForageSpecsDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageSpecsDel',
      data: data
    }
  })
}

// 饲料配方列表
export const spForageFormulaListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaList',
      data: data
    }
  })
}

// 饲料配方新增
export const spForageFormulaAddAdminApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaAddAdmin',
      data: data
    }
  })
}

// 饲料配方查看
export const spForageFormulaSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaSee',
      data: data
    }
  })
}

// 饲料配方修改
export const spForageFormulaEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaEdit',
      data: data
    }
  })
}
// 饲料配方删除
export const spForageFormulaDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaDel',
      data: data
    }
  })
}

// 饲料配方停用启用
export const spForageFormulaIsStopApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageFormulaIsStop',
      data: data
    }
  })
}

// 饲料出入库列表
export const spForageStockInOutLogListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'spForageStockInOutLogList',
      data: data
    }
  })
}
